home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Free Software Collection: Marty 1
/
FM Towns Marty 1 Free Software Collection.iso
/
tool
/
m_term
/
m_term.sct
< prev
next >
Wrap
Text File
|
1993-11-11
|
10KB
|
527 lines
#
# MTERM main script
#
USER_DEF = A:\USER.DEF
if test -f A:\M_TERM.LOG
then
set def_edit_file A:\M_MENU.LOG
fi
echo "\nConsl Simulation ver1.00\n\n"
#
# main key function define
#
mainkey PF1 main_mode_select
mainkey PF9 main_edit_mode
mainkey PF10 main_term_mode
mainkey PF11 main_cons_mode
mainkey PF12 main_end_of
mainkey PF13 main_pal
mainkey SELECT pfkey_select
function main_pal {
palette setup
}
function main_mode_select {
menu 0 "1 通信を行う" \
"2 編集を行う" \
"3 画面を選ぶ" \
"4 終了する "
switch $?
case 0
main term
exit 2
break
case 1
main edit
exit 2
break
case 2
main screen_select
exit 2
break
case 3
if yesno "終了していいですか?"
then
edit all_save_file
exit 1
fi
done
exit 3
}
function main_end_of {
if yesno "終了していいですか?"
then
edit all_save_file
exit 1
else
exit 3
fi
}
function main_edit_mode { main edit; }
function main_term_mode { main term; }
function main_cons_mode { main cons; }
#
# edit key function define
#
edit menu_set "動作選択" "編集MENU1" "編集MENU2" ""
editkey ^@ nodef
editkey ^A word_left
editkey ^B search_back
editkey ^C page_down
editkey ^D cursol_right
editkey ^E cursol_up
editkey ^F word_right
editkey ^G delete_char
editkey ^H delete_left
editkey ^I tab_putc
editkey ^J nodef
editkey ^K file_select
editkey ^L search_word
editkey ^M insert_line
editkey ^N search_next
editkey ^O nodef
editkey ^P nodef
editkey ^Q key_shift
editkey ^R page_up
editkey ^S cursol_left
editkey ^T nodef
editkey ^U nodef
editkey ^V nodef
editkey ^W screen_down
editkey ^X cursol_down
editkey ^Y delete_line
editkey ^Z screen_up
editkey ^[ joy_abort_buff
editkey ^\\ cursol_right
editkey ^] cursol_left
editkey ^^ cursol_up
editkey ^_ cursol_down
editkey +A line_top
editkey +C file_btm
editkey +F line_btm
editkey +R file_top
editkey PF4 nodef
editkey PF5 select_buff
editkey PF6 cut_buff
editkey PF7 get_buff
editkey PF8 paste_buff
editkey PF9 nodef
editkey PF10 nodef
editkey PF11 nodef
editkey PF12 nodef
editkey PF13 nodef
editkey PF14 nodef
editkey PF15 nodef
editkey PF16 nodef
editkey PF17 nodef
editkey PF18 nodef
editkey PF19 nodef
editkey PF20 nodef
editkey 前行 page_up
editkey 次行 page_down
editkey 挿入 insert_mode
editkey 削除 delete_char
editkey HOME file_select
editkey BREAK nodef
editkey COPY nodef
editkey SELECT nodef
editkey START nodef
editkey SWB joy_abort_buff
editkey SWA joy_get_buff
editkey RIGHT cursol_right
editkey LEFT cursol_left
editkey DOWN cursol_down
editkey UP cursol_up
editkey MOS_A_ON mos_start
editkey MOS_A_MOVE mos_goto_xy
editkey MOS_A_DOUBLE mos_double
editkey MOS_A_OFF mos_end
editkey MOS_B_ON mos_start
editkey MOS_B_MOVE mos_goto_xy
editkey MOS_B_DOUBLE mos_double
editkey MOS_B_OFF mos_end
editkey PF2 edit_pf2_menu
function edit_pf2_menu {
menu 1 "1 文書 ファイル を編集する" \
"2 通 信のLOGを編集する" \
"3 文 書 をアップロ-ドする" \
"4 文書をファイルへ保存する" \
"5 別の文 書 を編集する" \
"6 編集中の文 書 を消去" \
"7 編集する文 書 を選択"
switch $?
case 0
edit read_file
break
case 1
term log_to_edit
break
case 2
edit send_edit_buff
break
case 3
edit save_file
break
case 4
edit new_file
break
case 5
edit quit_file
break
case 6
edit file_select
break
done
}
editkey PF3 edit_pf3_menu
function edit_pf3_menu {
menu 2 "1 文字列を検索する " \
"2 文字列の置き換えを行う" \
"" \
"3 指定行へ移動する " \
"4 文書の先頭に移動する " \
"5 文書の最後に移動する "
switch $?
case 0
edit search_cmds
break
case 1
edit replace_cmds
break
case 3
edit goto_cmds
break
case 4
edit file_top
break
case 5
edit file_btm
break
done
}
#
# term key function define
#
term menu_set "動作選択" "通信MENU1" "通信MENU2" ""
termkey PF4 NULL
termkey PF5 his_select_buff
termkey PF6 his_get_buff
termkey PF7 setup_term
termkey 前行 his_up
termkey 次行 his_down
termkey RIGHT his_right
termkey LEFT his_left
termkey UP his_up
termkey DOWN his_down
termkey SWA his_joy_get_buff
termkey SWB his_joy_abort_buff
termkey MOS_A_ON mos_start
termkey MOS_A_MOVE mos_move
termkey MOS_A_DOUBLE mos_double
termkey MOS_A_OFF mos_end
termkey BREAK term_break
function term_break { sendbreak; }
termkey PF8 term_hungup
function term_hungup { hungup; }
termkey PF2 term_pf2_menu
function term_pf2_menu {
menu 1 "1 Nifty-Serveに接続する" \
"2 TextFileアップロ-ド " \
"3 TextFileダウンロ-ド " \
"4 Xmodem アップロ-ド " \
"5 Xmodem ダウンロ-ド " \
"6 Nifty-Serveの設定 " \
"7 通信モ-ドの設定 " \
"8 接続を切る "
switch $?
case 0
nifty_access
break
case 1
term send_text
break
case 2
term recive_text
break
case 3
term send_xmodem
break
case 4
term recive_xmodem
break
case 5
nifty_setup
break
case 6
term setup_term
break
case 7
hungup
break
done
}
termkey PF3 term_pf3_menu
function term_pf3_menu {
menu 2 "1 ファイル名のみ送信 " \
"2 すべてのLOGをセ-ブ"
switch $?
case 0
transmit `fileselect`
break
case 1
term log_to_file
break
done
}
#
# cons key function define
#
cons menu_set "動作選択" "実行MENU1" "実行MENU2" ""
conskey PF4 NULL
conskey PF5 his_select_buff
conskey PF6 his_get_buff
conskey PF7 setup_cons
conskey 前行 his_up
conskey 次行 his_down
conskey RIGHT his_right
conskey LEFT his_left
conskey UP his_up
conskey DOWN his_down
conskey SWA his_joy_get_buff
conskey SWB his_joy_abort_buff
conskey MOS_A_ON mos_start
conskey MOS_A_MOVE mos_move
conskey MOS_A_DOUBLE mos_double
conskey MOS_A_OFF mos_end
conskey PF2 cons_pf2_menu
function cons_pf2_menu {
menu 1 "1 すべてのLOGをセ-ブ"
switch $?
case 0
cons log_to_file
break
done
}
#
# user defs script load
#
nifty_modem_init = "AT\\N3\\V1\\Q3\\J0"
nifty_modem_line = "T"
nifty_road = "1"
set baud "2400"
set bit "8Bit"
set parity "無し"
set stopbit "1Bit"
set flow "RTS/CTS"
rsinit
set break "200ms"
set crwait "500ms"
set bplus "する"
set kanji "sjis"
set buffer "32K"
set line "off"
if test -f $USER_DEF
then
call $USER_DEF
fi
#
# nifty auto login
#
function send_modem_command {
for n in $*
do
if test -z $n
then
continue
fi
transmit "$n\r"
if ! rswait 10 "OK\r\n"
then
message "モデムからの反応がありません"
exit 1
fi
done
exit 0
}
function tel_call {
if send_modem_command $1
then
transmit "ATD"
transmit $2
transmit $3
rsloop 1
transmit "\r"
if rswait 60 "CONNECT" "NO" "BUSY"
then
exit 0
fi
fi
exit 1
}
function nifty_access {
if test -z "$nifty_telephon" -o \
-z "$nifty_user_id" -o \
-z "$nifty_password"
then
message "Niftyの登録がされていません"
exit 1
fi
message "Niftyへ接続中です"
rt = 0
while ! tel_call $nifty_modem_init $nifty_modem_line $nifty_telephon
do
rt = `expr $rt + 1`
if test $rt -eq 10
then
message "接続しませんでした"
exit 1
else
message "再度接続を試みます"
fi
sleep 10
done
if test $nifty_road -eq 2
then
transmit "@P\r"
if ! rswait 10 "*"
then
message "ROAD${nifty_road}にアクセスできません"
exit 1
fi
fi
if test $nifty_road -eq 3
then
if ! rswait 10 "*"
then
message "ROAD${nifty_road}にアクセスできません"
exit 1
fi
fi
rt = 0
while true
do
if test nifty_road -eq 1
then
transmit ".00+"
else
transmit "C NIF\r"
fi
if rswait 10 "COM"
then
break
fi
n = `expr $rt + 1`
if test $rt -eq 10
then
message "Niftyに接続できません"
exit 1
fi
done
if ! rswait 10 "->"
then
message "Niftyが反応していません"
exit 1
fi
transmit "SVC\r"
if ! rswait 10 "->"
then
message "ユ-ザ-IDの入力指示が反応していません"
exit 1
fi
transmit "$nifty_user_id\r"
if ! rswait 10 "->"
then
message "パスワ-ドの入力指示が反応していません"
exit 1
fi
transmit "$nifty_password\r"
exit 0
}
function nifty_setup {
read nifty_modem_init "モデムのイニシャライズ" "$nifty_modem_init" &&
read nifty_modem_line "電話の種類 T(プッシュ)or P(パルス)" \
"$nifty_modem_line" &&
read nifty_telephon "アクセスポイント" "$nifty_telephon" &&
read nifty_road "FENICS-ROAD 1 or 2,3" "$nifty_road" &&
read nifty_user_id "Nifty-Serveのユ-ザ-ID" "$nifty_user_id" &&
read nifty_password "Nifty-Serveのパスワ-ド" "$nifty_password"
if test $? -ne "0"
then
exit 1
fi
if ! yesno "定義ファイルをA:ドライブに作成しますか?"
then
exit 1
fi
echo "nifty_modem_init = \"$nifty_modem_init\"" >$USER_DEF &&
echo "nifty_modem_line = \"$nifty_modem_line\"" >>$USER_DEF &&
echo "nifty_telephon = \"$nifty_telephon\"" >>$USER_DEF &&
echo "nifty_road = \"$nifty_road\"" >>$USER_DEF &&
echo "nifty_user_id = \"$nifty_user_id\"" >>$USER_DEF &&
echo "nifty_password = \"$nifty_password\"" >>$USER_DEF
}